package com.kldy8.kldyw.model;

import com.kldy8.kldyw.filmfactory.bean.Company;

import org.json.JSONObject;

/**
 * Created by user on 2016/12/14.
 */

public class WebViewJavascriptBridgeOrder
{
    public final static String ACTION_TOLOGIN = "ToLogin";
    public final static String ACTION_LOGOUT  = "Logout";
    public final static String ACTION_LOGIN  = "Login";
    public final static String ACTION_BACKTRACK  = "Backtrack";
    public final static String ACTION_SWITCHLOGIN  = "SwitchLogin";
    public final static String ACTION_SHARE = "Share";
    public final static String ACTION_APPROVE = "Approve";
    public final static String ACTION_BUBLISHVIDEO = "BublishVideo";


    public String action;
    public WebViewJavascriptBridgeDataOrder data;

    public static WebViewJavascriptBridgeOrder resolution(JSONObject jsonObject)
    {
        if (jsonObject == null)
        {
            return  null;
        }

        WebViewJavascriptBridgeOrder m_new = new WebViewJavascriptBridgeOrder();
        m_new.action = jsonObject.optString("action");
        JSONObject jsonObjectData = jsonObject.optJSONObject("data");
        if (jsonObjectData != null)
        {
            m_new.data =   WebViewJavascriptBridgeDataOrder.resolution(jsonObjectData);
        }
        return m_new;
    }

}
